class TorchRenderer : public IBlockRenderer
{
public:
	ITexture *Texture;
	Point2i TexturePosition;

	TorchRenderer(ITexture *texture, const Point2i &pos) :
		Texture(texture),
		TexturePosition(pos)
	{
	}

	int GetTypeData(const int &data) { return 0; }

	void Render(Schematic *schematic, RendererBase *renderer, const Block &block, const Point3i &position)
	{
		if (block.Data <= 4)
		{
			renderer->Translate(8, 5, 8);
			switch (block.Data)
			{
			case 1:
				renderer->Translate(-5.5, 0, 0);
				renderer->Rotate(20, 0, 0, 1);
				break;
			case 2:
				renderer->Translate(5.5, 0, 0);
				renderer->Rotate(-20, 0, 0, 1);
				break;
			case 3:
				renderer->Translate(0, 0, -5.5);
				renderer->Rotate(-20, 1, 0, 0);
				break;
			case 4:
				renderer->Translate(0, 0, 5.5);
				renderer->Rotate(20, 1, 0, 0);
				break;
			}
			renderer->Translate(-8, -8, -8);
		}

		renderer->Draw(Face(Point3f(7, 6, 7), Point3f(9, 6, 7), Point3f(9, 6, 9), Point3f(7, 6, 9), Colorb::White, Texture, TexturePosition + Point2i(7, 6), 2, 2));
		renderer->Draw(Face(Point3f(9, 16, 7), Point3f(7, 16, 7), Point3f(7, 16, 9), Point3f(9, 16, 9), Colorb::White, Texture, TexturePosition + Point2i(7, 14), 2, 2));
		
		for (int i = 0; i < 4; ++i)
		{
			renderer->Translate(8, 8, 8);
			renderer->Rotate(90, 0, 1, 0);
			renderer->Translate(-8, -8, -8);
			renderer->Draw(Face(Point3f(6, 5, 9), Point3f(10, 5, 9), Point3f(10, 16, 9), Point3f(6, 16, 9), Colorb::White, Texture, TexturePosition + Point2i(6, 5), 4, 11));
		}
	}
};